package com.example.springboot.controller;


import com.example.springboot.entity.FirstEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @RestController
 * https://www.cnblogs.com/javaxubo/p/16862804.html
 * */

@RestController
public class FirstController {

/**
 * @RequestMapping
 * https://blog.csdn.net/weixin_42910765/article/details/100918595
 *
 * */



    // 测试： http://localhost:8080/
    @RequestMapping
    public String test(){
        return "test";
    }

    // 测试： http://localhost:8080/test2
    @RequestMapping(value = "test2",method = RequestMethod.GET)
    public FirstEntity test2(){

        FirstEntity fe = new FirstEntity();
        fe.setId(1);
        fe.setName("test");

        return fe;
    }

}
